//
//  FLMLeftMenuCell.m
//  FLMSuperS
//
//  Created by xiaoyang on 16/9/17.
//  Copyright © 2016年 FaLaoMiaoNetworkTechnologyCo. All rights reserved.
//

#import "FLMLeftMenuCell.h"
#import "GDFadeView.h"

@interface FLMLeftMenuCell()

@property (nonatomic,strong) GDFadeView *fadeView;
@property (nonatomic,strong) UIImageView *imageV;

@end

@implementation FLMLeftMenuCell


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = [UIColor clearColor];
        [self layoutUI];
    }
    
    return self;
}

- (void)layoutUI
{
    if (!_imageV) {
        _imageV = [[UIImageView alloc]init];
        [self.contentView addSubview:_imageV];
        [_imageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(@15);
            make.centerY.equalTo(self.contentView.mas_centerY);
            make.width.equalTo(@30);
            make.height.equalTo(@30);
        }];
    }
    
    if (!_fadeView) {
        _fadeView = [[GDFadeView alloc] initWithFrame:CGRectMake(50, self.frame.size.height/2-20, ScreenW-50, 50)];
        _fadeView.foreColor = [UIColor whiteColor];
        _fadeView.backColor = [UIColor blackColor];
        _fadeView.font = [UIFont systemFontOfSize:17];
        [self.contentView addSubview:_fadeView];
        [_fadeView iPhoneFadeWithDuration:2.50];
    }
}

- (void)configCellWithTitle:(NSString *)title icon:(NSString *)icon
{
    _fadeView.text = title;
    _imageV.image = [UIImage imageNamed:icon];
}

@end
